package com.mmy.dao.group;

import javax.transaction.Transactional;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import com.mmy.domain.group.TGroupNotice;


/**
 * @vesion 
 * @description 
 * @author liys
 * @date 2021-5-24
 */
public interface TGroupNoticeRepository extends JpaRepository<TGroupNotice, Integer>{
	
	/**
	  * @descr 获得当前最大编号
	  * @param 
	  * @return 
	  * @throws 
	  * @author liys
	  * @date 2021-6-1
	 */
	@Query(value = "select MAX(iNoticeID) from tGroupNotice ", nativeQuery = true)
	Object getMaxID();
	
	/**
	  * @descr 创建只含id的对象 
	  * @param 
	  * @return 
	  * @throws 
	  * @author liys
	  * @date 2021-6-4
	 */
	@Transactional
	@Modifying
	@Query(value = "INSERT INTO tGroupNotice(iNoticeID, iTeamID, iGuideID, cDeliver, cDeliverTel, cPlaceID, cTime, cSign, iPlaneOutPlanID, iPlaneIntPlanID, cPickUp, cPickUpTel, cNoticePath, dCreateDate, iCreatorID, cCreator, dModifyDate, iReviserID, cReviser, cMemo, iSpare1, fSpare2, cSpare3, cSpare4, cSpare5) "
			+ "VALUES (:id, 0, 0, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)", nativeQuery = true)
	int save(@Param("id")int id);
}
